/**
 * @format
 * @Author: TC
 * @Date: 2025-04-26 08:52:31
 * @Last Modified by: TC (tengchao@taqu.cn)
 * @Last Modified time: 2025-10-21 16:57:53
 */

import { _decorator } from "cc";
import { app } from "../../../../FrameWork/App";
import { EFrameEventConst } from "../../../../FrameWork/Const/FrameEventConst";
import { BaseScene } from "../../../../FrameWork/Module/Component/BaseScene";
import { EMoleUIConst, MoleUIConfig } from "./Const/MoleUIConst";
import { gameMole } from "./GameMole";
const { ccclass } = _decorator;

/**
 * 游戏场景
 */
@ccclass("MoleScene")
export class MoleScene extends BaseScene {
    /**
     * 初始化
     */
    protected init(): void {
        super.init();
        app.uiMgr.addUICfg(MoleUIConfig);
    }

    protected registerEvent(): void {
        super.registerEvent();
        app.eventMgr.register(EFrameEventConst.ENTER_GAME_SCENE, this._onEnterGameScene, this);
    }

    /**
     * 打开主界面
     */
    private _onEnterGameScene(): void {
        app.uiMgr.openUI(EMoleUIConst.MainUI, null, () => {
            this.destroyLoadingUI();
        });
    }
}
